package br.com.strings_serializacao;

import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
/**
 * FileReader sem uso de wrapping
 * @author Sidney
 *
 */
public class ExemploFileReader {
	public static void main(String[] args) {
		char [] c = new char[70];
		File f = new File("c:\\TesteReader.txt");
		try{
			f.createNewFile();
			FileWriter fw = new FileWriter(f);
			fw.write("Usando FileReader sem wrapping");
			fw.flush();
			fw.close();
			System.out.println(f.isFile());
			System.out.println(f.isDirectory());
						
			FileReader fr = new FileReader(f);
			fr.read(c);//le o array de caracteres
			for(char carac : c){
				System.out.print(carac);
				fr.close();
			}
		}catch(IOException e){e.printStackTrace();}
	}

}
